package icu.bughub.app.app.ui.components.video

import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import com.tencent.rtmp.TXVodPlayer
import com.tencent.rtmp.ui.TXCloudVideoView

@Composable
fun VideoView(vodPlayer: TXVodPlayer) {

    // https://license.vod2.myqcloud.com/license/v2/1300501617_1/v_cube.license

    // 9b3ad1f14d7da220da7c54d642ca0f9d

    /*    AndroidView(factory = { context ->
            (LayoutInflater.from(context).inflate(R.layout.video, null, false)
                .findViewById<TXCloudVideoView>(R.id.video_view)).apply {
                    vodPlayer.setPlayerView(this)
                }
        })*/

    AndroidView(factory = { context ->
        TXCloudVideoView(context).apply {
            vodPlayer.setPlayerView(this)
        }
    }, modifier = Modifier.height(300.dp))

}
